{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import keras\n",
    "from keras import models\n",
    "from keras import layers\n",
    "from keras.datasets import mnist"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "(x_train,y_train),(x_test,y_test) = mnist.load_data()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(60000, 28, 28)\n",
      "[[  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   3  18  18  18 126 136\n",
      "  175  26 166 255 247 127   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0  30  36  94 154 170 253 253 253 253 253\n",
      "  225 172 253 242 195  64   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0  49 238 253 253 253 253 253 253 253 253 251\n",
      "   93  82  82  56  39   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0  18 219 253 253 253 253 253 198 182 247 241\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0  80 156 107 253 253 205  11   0  43 154\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0  14   1 154 253  90   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0 139 253 190   2   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0  11 190 253  70   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0  35 241 225 160 108   1\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0  81 240 253 253 119\n",
      "   25   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0  45 186 253 253\n",
      "  150  27   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0  16  93 252\n",
      "  253 187   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 249\n",
      "  253 249  64   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0  46 130 183 253\n",
      "  253 207   2   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0  39 148 229 253 253 253\n",
      "  250 182   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0  24 114 221 253 253 253 253 201\n",
      "   78   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0  23  66 213 253 253 253 253 198  81   2\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0  18 171 219 253 253 253 253 195  80   9   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0  55 172 226 253 253 253 253 244 133  11   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0 136 253 253 253 212 135 132  16   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   0   0   0   0   0   0]]\n",
      "(60000,)\n",
      "7\n"
     ]
    }
   ],
   "source": [
    "#观察数据\n",
    "print(x_train.shape)\n",
    "print(x_train[0])\n",
    "print(y_train.shape)\n",
    "print(y_test[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#数据预处理\n",
    "x_train = x_train.astype('float32')/255.0\n",
    "x_test = x_test.astype('float32')/255.0\n",
    "\n",
    "y_train = keras.utils.to_categorical(y_train)\n",
    "y_test = keras.utils.to_categorical(y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0., 0., 0., 0., 0., 1., 0., 0., 0., 0.], dtype=float32)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_train[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "?? layers.Conv2D"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "#构建网络\n",
    "model = models.Sequential()\n",
    "model.add(layers.Conv2D(64,(3,3),activation='relu',input_shape=(28,28,1)))\n",
    "model.add(layers.MaxPooling2D((2,2)))\n",
    "model.add(layers.Conv2D(32,(3,3),activation='relu'))\n",
    "model.add(layers.MaxPooling2D(2,2))\n",
    "model.add(layers.Flatten())\n",
    "model.add(layers.Dense(128,activation='relu'))\n",
    "model.add(layers.Dropout(0.2))\n",
    "model.add(layers.Dense(64,activation='relu'))\n",
    "model.add(layers.Dropout(0.2))\n",
    "model.add(layers.Dense(10,activation='softmax'))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "conv2d_6 (Conv2D)            (None, 26, 26, 64)        640       \n",
      "_________________________________________________________________\n",
      "max_pooling2d_5 (MaxPooling2 (None, 13, 13, 64)        0         \n",
      "_________________________________________________________________\n",
      "conv2d_7 (Conv2D)            (None, 11, 11, 32)        18464     \n",
      "_________________________________________________________________\n",
      "max_pooling2d_6 (MaxPooling2 (None, 5, 5, 32)          0         \n",
      "_________________________________________________________________\n",
      "flatten_3 (Flatten)          (None, 800)               0         \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 128)               102528    \n",
      "_________________________________________________________________\n",
      "dropout_2 (Dropout)          (None, 128)               0         \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 64)                8256      \n",
      "_________________________________________________________________\n",
      "dropout_3 (Dropout)          (None, 64)                0         \n",
      "_________________________________________________________________\n",
      "dense_5 (Dense)              (None, 10)                650       \n",
      "=================================================================\n",
      "Total params: 130,538\n",
      "Trainable params: 130,538\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.build()\n",
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.compile(optimizer=keras.optimizers.RMSprop(),loss=keras.losses.categorical_crossentropy,metrics=['acc'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train = x_train.reshape((60000,28,28,1))\n",
    "x_data = x_train[:50000]\n",
    "y_data = y_train[:50000]\n",
    "val_x_data = x_train[50000:]\n",
    "val_y_data = y_train[50000:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 50000 samples, validate on 10000 samples\n",
      "Epoch 1/20\n",
      "50000/50000 [==============================] - 21s 425us/step - loss: 0.3424 - acc: 0.8930 - val_loss: 0.0820 - val_acc: 0.9767\n",
      "Epoch 2/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0948 - acc: 0.9726 - val_loss: 0.0623 - val_acc: 0.9837\n",
      "Epoch 3/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0625 - acc: 0.9816 - val_loss: 0.0496 - val_acc: 0.9863\n",
      "Epoch 4/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0477 - acc: 0.9857 - val_loss: 0.0425 - val_acc: 0.9878\n",
      "Epoch 5/20\n",
      "50000/50000 [==============================] - 6s 117us/step - loss: 0.0390 - acc: 0.9884 - val_loss: 0.0406 - val_acc: 0.9884\n",
      "Epoch 6/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0340 - acc: 0.9902 - val_loss: 0.0385 - val_acc: 0.9897\n",
      "Epoch 7/20\n",
      "50000/50000 [==============================] - 6s 115us/step - loss: 0.0296 - acc: 0.9915 - val_loss: 0.0415 - val_acc: 0.9908\n",
      "Epoch 8/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0251 - acc: 0.9930 - val_loss: 0.0456 - val_acc: 0.9906\n",
      "Epoch 9/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0241 - acc: 0.9928 - val_loss: 0.0408 - val_acc: 0.9910\n",
      "Epoch 10/20\n",
      "50000/50000 [==============================] - 6s 117us/step - loss: 0.0205 - acc: 0.9940 - val_loss: 0.0440 - val_acc: 0.9905\n",
      "Epoch 11/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0178 - acc: 0.9947 - val_loss: 0.0435 - val_acc: 0.9896\n",
      "Epoch 12/20\n",
      "50000/50000 [==============================] - 6s 115us/step - loss: 0.0164 - acc: 0.9952 - val_loss: 0.0456 - val_acc: 0.9892\n",
      "Epoch 13/20\n",
      "50000/50000 [==============================] - 6s 115us/step - loss: 0.0167 - acc: 0.9950 - val_loss: 0.0514 - val_acc: 0.9888\n",
      "Epoch 14/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0148 - acc: 0.9957 - val_loss: 0.0500 - val_acc: 0.9902\n",
      "Epoch 15/20\n",
      "50000/50000 [==============================] - 6s 115us/step - loss: 0.0140 - acc: 0.9959 - val_loss: 0.0511 - val_acc: 0.9912\n",
      "Epoch 16/20\n",
      "50000/50000 [==============================] - 6s 116us/step - loss: 0.0129 - acc: 0.9962 - val_loss: 0.0451 - val_acc: 0.9914\n",
      "Epoch 17/20\n",
      "50000/50000 [==============================] - 6s 115us/step - loss: 0.0131 - acc: 0.9958 - val_loss: 0.0573 - val_acc: 0.9909\n",
      "Epoch 18/20\n",
      "50000/50000 [==============================] - 6s 117us/step - loss: 0.0116 - acc: 0.9965 - val_loss: 0.0662 - val_acc: 0.9908\n",
      "Epoch 19/20\n",
      "50000/50000 [==============================] - 6s 115us/step - loss: 0.0130 - acc: 0.9964 - val_loss: 0.0720 - val_acc: 0.9899\n",
      "Epoch 20/20\n",
      "50000/50000 [==============================] - 6s 115us/step - loss: 0.0127 - acc: 0.9962 - val_loss: 0.0458 - val_acc: 0.9898\n"
     ]
    }
   ],
   "source": [
    "history = model.fit(x_data,y_data,batch_size=128,epochs=20,validation_data=(val_x_data,val_y_data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "history = history.history"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X2QFPW97/H3l90FRFBgQSWssJgYI0/ysBKNiZLoJWhZ\n+IBG1JyoyZWKhJRWriaYaELpNamcxCQn14fjmksdNZwQY6Ko16jIQa2c0oRFRQKIImhYQFgeBZXg\nst/7x6+HHWZntmd3tmd22c+rqmv64dc9v+2d7c/+unt+be6OiIhIa3qUugIiItL5KSxERCSWwkJE\nRGIpLEREJJbCQkREYiksREQklsJCRERiKSxERCSWwkJERGKVJ7VhM5sHnA9sdffRWZYb8G/AecCH\nwNXu/kq07Crglqjo/3b3B+Leb9CgQV5dXd1BtRcR6R6WLVu2zd0Hx5VLLCyA/wDuAh7Msfxc4MRo\n+CxwL/BZMxsI/AioARxYZmaPu/vO1t6surqaurq6Dqq6iEj3YGbv5lMusdNQ7v4isKOVIhcAD3rw\nMtDfzIYAXwYWufuOKCAWAVOTqqeIiMQr5TWLocCGtOn6aF6u+S2Y2UwzqzOzuoaGhsQqKiLS3ZUy\nLCzLPG9lfsuZ7rXuXuPuNYMHx55yExGRdiplWNQDx6dNVwGbWpkvIiIlUsqweBz4mgWnAbvdfTPw\nDDDFzAaY2QBgSjRPRERKJLGwMLPfAS8BJ5lZvZl9w8y+aWbfjIo8BawD1gL3A7MA3H0HcDuwNBpu\ni+aJiHQqs2ZBeTmYhddZs4q7flG5+2ExTJw40UWka7nuOveyMncIr9dd13XWv+66sF7mkO82Cl2/\n0PqnAHWexzG25Af5jhoUFiLF15UPtoWun/q5M4eysuKs3xFh466wEOkWuvJ/1qU+2Ba6frZ1U0Mx\n1i+0/s31yC8s1DeUSAkVcs561iy49144cCBMHzgQpvPdRqHr19a2bX6m1PvmO7+zrV9W1rb5Hb1+\nofVvK4WFSAFKebAv9GBd6oN9qQ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4/iOan19GAuwl3\noqwAaopcxz6Eg//RafNKtg8JobUZ+Jjwn9o3gEpgMfBW9DowKlsD/CZt3a8Da6PhmiLWby3hXHXq\nc/jvUdlPAE+19lkoUv0eij5brxMOekMy6xdNn0e4++ftYtYvmv8fqc9cWtlS7L9cx5Wifwb1DW4R\nEYml01AiIhJLYSEiIrEUFiIiEkthISIisRQWIiISS2EhUkQWes19stT1EGkrhYWIiMRSWIi0gZl9\n1cz+Fj3D4D4zKzOzvWZ2p5m9YmaLzWxwVPZTZvZc1OnhK2b2yWgzfc3sEQvPnJif9o30s83s1egZ\nCfPMrFfJflCRDAoLkTyZ2cnAZYQO5MYBB4ArgSMJfVlNAF4AfhStMh+420Onh58jfFMYQs+hNxCe\nS3ACcIZulAOxAAABLklEQVSZ9SZ8a/gydx8DlAPXFePnEsmHwkIkf2cDE4Gl0dPTziYc7Jto7nDu\nt8Dno36Dhrr7owDuvs+b+2n6m7vXe+hI7zWgGjgJWO/ub0ZlHiA8mEekUygvdQVEuhADHnD3mw+Z\naXZrRjkne/fQKf9MGz9A+DtsrbxIyallIZK/xcAlZnYMHHwO8nDC39ElUZkrgL94eOZAvZldGJXt\nZWZ9Wtn2G0C1mX0qmv4XwiktkU5BLQuRPLn7KjO7hfB0tB6Enkq/BXwAjDKzZcBuwnUNCAf8+8zs\ntqjspa1se5+ZXQP8IXqWwlLg35P7aUTaRr3OihTIzPa6e99S10MkSToNJSIisdSyEBGRWGpZiIhI\nLIWFiIjEUliIiEgshYWIiMRSWIiISCyFhYiIxPr/iZFvpe+6RXUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1ad53b8b940>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "epoch = range(1,len(history['acc'])+1)\n",
    "plt.plot(epoch,history['acc'],'bo',label='train acc')\n",
    "plt.plot(epoch,history['val_acc'],'b',label='val acc')\n",
    "plt.xlabel('epcho')\n",
    "plt.ylabel('acc')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XucFNWd9/HPjwGcICgIGJW7ihcQGGREjLuwRkW8Ia4Y\nUVQ0rqyJZDXuuuKiqy+zboyXaHweEiWueVQmwUvihngjSlB0V5QBwQhquMhlwMuAgJARhJnf88ep\ncZqmZ6rnUtM98H2/XvXq7qpT1adreurbdarqlLk7IiIidWmV6wqIiEj+U1iIiEgshYWIiMRSWIiI\nSCyFhYiIxFJYiIhILIWFiIjEUliIiEgshYWIiMRqnesKNJUuXbp47969c10NEZEWZcGCBRvcvWtc\nub0mLHr37k1paWmuqyEi0qKY2epsyiXaDGVmo8zsQzNbbmaTM0y/xsz+bGaLzOwNM+sXje9tZl9G\n4xeZ2UNJ1lNEROqW2J6FmRUAU4HTgTJgvpnNdPelKcV+7e4PReVHAz8FRkXTVrh7UVL1ExGR7CW5\nZzEUWO7uK939K2AGcF5qAXf/IuXl/oC6wBURyUNJHrPoBqxNeV0GnJheyMyuBW4A2gLfTpnUx8ze\nAb4AbnH31xOsq4jksZ07d1JWVsb27dtzXZUWq7CwkO7du9OmTZsGzZ9kWFiGcXvsObj7VGCqmV0C\n3AJMAD4Gerr7RjMbAvy3mfVP2xPBzCYCEwF69uzZ1PUXkTxRVlZGhw4d6N27N2aZNi1SF3dn48aN\nlJWV0adPnwYtI8lmqDKgR8rr7sD6OsrPAMYAuPsOd98YPV8ArACOSp/B3ae5e7G7F3ftGnvmV0Yl\nJdC7N7RqFR5LShq0GBFJ0Pbt2+ncubOCooHMjM6dOzdqzyzJsJgP9DWzPmbWFhgHzEwtYGZ9U16e\nDSyLxneNDpBjZocDfYGVTV3BkhKYOBFWrwb38DhxogJDJB8pKBqnsesvs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.figure.Figure at 0x1ad560646a0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(epoch,history['loss'],'bo',label='train loss')\n",
    "plt.plot(epoch,history['val_loss'],'b',label='val loss')\n",
    "plt.xlabel('epcho')\n",
    "plt.ylabel('loss')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x_test = x_test.reshape((10000,28,28,1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10000/10000 [==============================] - 0s 42us/step\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[0.039836864763876656, 0.9914]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "model.evaluate(x_test,y_test,batch_size=128)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
